package com.wtp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.ListView;

public class HistoryActivity extends Activity implements OnClickListener, OnItemClickListener {

	ListView listView;
	OrderListAdapter adapter;
	Button back, serach_btn;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_history);
		serach_btn = (Button) findViewById(R.id.serach_btn);
		back = (Button) findViewById(R.id.back);

		listView = (ListView) findViewById(R.id.list);
		adapter = new OrderListAdapter(this, 1, 1,2);
		listView.setAdapter(adapter);
		serach_btn.setOnClickListener(this);
		back.setOnClickListener(this);
		listView.setOnItemClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.back:
			finish();
			break;

		case R.id.serach_btn:
			Intent intent = new Intent(this, SerachActivity.class);
			startActivity(intent);
			break;
		default:
			break;
		}
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		Intent intent = new Intent(this, WebActivity.class);
		intent.putExtra("url", "file:///android_asset/web/abcde.html");
		startActivity(intent);
	}

}
